<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('站点配置')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-site-config-edit" th:object="${config}">
			<input type="hidden" name="token" th:value="${session.token}"/>
			<input id="configId" name="id" type="hidden" th:field="*{id}" />
			<div class="form-group">
				<div class="alert alert-info col-sm-12" role="alert">
					<div class="col-sm-6">站点名称：[[${config.site.channelName}]] </div>
					<div class="col-sm-6">站点状态：[[${@dict.getName('sys_data_status', config.site.status)}]] </div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">存储地址：</label>
				<div class="col-sm-9">
					<input class="form-control" type="text" placeholder="/home/data/ 或 D:/data/ " name="sitePath" th:field="*{sitePath}" required="required">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">站点编码：</label>
				<div class="col-sm-9">
					<input class="form-control" type="text" placeholder="请填写站点编码，仅限英文、数字以及下划线组成" name="siteCode" th:field="*{siteCode}" required="required">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">站点地址：</label>
				<div class="col-sm-9">
					<input class="form-control" type="text" placeholder="http://127.0.0.1:8080/" name="siteUrl" th:field="*{siteUrl}" required="required">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">发布地址：</label>
				<div class="col-sm-9">
					<input class="form-control" type="text" name="publishUrl" th:field="*{publishUrl}" required="required">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">发布地址：</label>
				<div class="col-sm-9">
					<input class="form-control" type="text" name="publishUrl" th:field="*{publishUrl}" required="required">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">配置状态：</label>
				<div class="col-sm-9">
					<div class="radio-box" th:each="dict : ${@dict.getDict('sys_data_status')}">
						<input type="radio" th:id="${dict.id}" name="status" th:value="${dict.dictValue}" th:field="*{status}" readonly="readonly">
						<label th:for="${dict.id}" th:text="${dict.dictName}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">备注：</label>
				<div class="col-sm-9">
					<textarea name="remark" maxlength="500" class="form-control" rows="3" th:field="*{remark}"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "cms/site/config";
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-site-config-edit').serialize());
	        }
	    }
		
	</script>
</body>
</html>
